import Vue from 'vue'
import VueRouter from 'vue-router'

//首页
// import index from 'pages/index/index'
/*页面路由*/
import index_r from 'pages/index/routes'
import product_r from 'pages/product/routes'
import item_r from 'pages/item/routes'
import order_r from 'pages/order/routes'
import saled_r from 'pages/saled/routes'
import login_r from 'pages/login/routes'
import home_r from 'pages/home/routes'
import dept_r from 'pages/dept/routes'
import user_r from 'pages/user/routes'
import dis_r from 'pages/dis/routes'
import device_r from 'pages/device/routes'
let routes = [
    { 
        path: '/', 
        name: '/',
        meta: {
            menu: '产品管理',
            title: '产品列表'
        },
        component: () => import('pages/product/product_list.vue').then(e=>e.default)
    },
]

routes = routes.concat(
    index_r,
    product_r,
    item_r,
    order_r,
    saled_r,
    login_r,
    home_r,
    dept_r,
    user_r,
    dis_r,
    device_r,
)

//安装路由功能
Vue.use(VueRouter);
//创建 router 实例，然后传 `routes` 配置
export default new VueRouter({
  routes // （缩写）相当于 routes: routes
});